package com.linkhub.oms.component.aliyunoss.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Description: AliyunOssProperties
 * @Author: echo
 * @Date: 2024/5/8 17:20
 * @Version: 1.0
 */
@Data
@ConfigurationProperties(prefix = "aliyun-oss")
public class AliyunOssProperties {

    private String endpoint;

    private String accessKeyId;

    private String accessKeySecret;

    private String bucketName;

    private boolean customDomain;

    public String acquireEndpoint() {
        return customDomain ? endpoint : endpoint.replace("https://", String.format("https://%s.", bucketName));
    }


}
